//
//  SFPBodyRecordListCell.swift
//  StriveForPregnancy
//
//  Created by iOS-Czz on 2023/11/9.
//

import UIKit

class SFPBodyRecordListCell: UITableViewCell {
    @IBOutlet var dateLabel: UILabel!
    @IBOutlet var daysLabel: UILabel!
    @IBOutlet var weightLabel: UILabel!
    @IBOutlet var tyreLabel: UILabel!

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    var model: SFPBodyRecordModel? {
        didSet {
            self.dateLabel.text = self.model?.date
            self.daysLabel.text = self.model?.days
            self.weightLabel.attributedText = NSAttributedString.modifySubstring(String(format: "%@kg", self.model!.weight), targetSubstring: "kg", color: .black, font: UIFont.systemFont(ofSize: 12, weight: .regular))
            self.tyreLabel.attributedText = NSAttributedString.modifySubstring(String(format: "%@cm", self.model!.tyre), targetSubstring: "cm", color: .black, font: UIFont.systemFont(ofSize: 12, weight: .regular))
        }
    }
}
